import 'package:flutter_project01/constants/index.dart';
import 'package:flutter_project01/utils/RequestDio.dart';

class UserApi {
  // 发送验证码
  static Future sendCode(String mobile) {
    return requestDio.get(HTTP_PATH.SEND_CODE, params: {'mobile': mobile});
  }

  // 登陆
  static Future login(String mobile, String code) {
    return requestDio
        .post(HTTP_PATH.LOGIN, data: {'mobile': mobile, 'code': code});
  }

  // 获取用户信息
  static Future getUserInfo() {
    return requestDio.get(HTTP_PATH.USER_INFO);
  }
}
